// ==UserScript==
// @name         AutoTrimpsV2
// @version      2.1.6.9b-genbtc-4-2-2018
// @updateURL    https://github.com/genbtc/AutoTrimps/AutoTrimps2.js
// @description  Automate all the trimps!
// @author       zininzinin, spindrjr, belaith, ishakaru, genBTC, Unihedron, coderPatsy
// @include      *trimps.github.io*
// @include      *kongregate.com/games/GreenSatellite/trimps
// @grant        none
// ==/UserScript==
var ATversion = '2.1.6.9b-genbtc-4-2-2018';

////////////////////////////////////////////////////////////////////////////////
//Main Loader Initialize Function (loads first, load everything else)///////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////
var atscript = document.getElementById('AutoTrimps-script')
  , basepath = 'https://likexia.gitee.io/autotrimps/'
  , modulepath = 'modules/'
  ;
//This should redirect the script to wherever its being mirrored from.
if (atscript !== null) {
    basepath = atscript.src.replace(/autotrimps\.js$/, '');
}
//This could potentially do something one day. like: read localhost url from tampermonkey.
// AKA do certain things when matched on a certain url.
//if (atscript.src.includes('localhost')) {;};

//Script can be loaded like this: ATscriptLoad(modulepath, 'utils.js');
function ATscriptLoad(pathname, modulename) {
    if (modulename == null) debug("Wrong Syntax. Script could not be loaded. Try ATscriptLoad(modulepath, 'example.js'); ");
    var script = document.createElement('script');
    if (pathname == null) pathname = '';
    script.src = basepath + pathname + modulename + '.js';
    script.id = modulename + '_MODULE';
    //script.setAttribute('crossorigin',"use-credentials");
    //script.setAttribute('crossorigin',"anonymous");
    document.head.appendChild(script);
}
//Scripts can be unloaded like this: ATscriptUnload('scryer');
function ATscriptUnload(id) {
    var $link = document.getElementById(id + '_MODULE');
    if (!$link) return;
    document.head.removeChild($link);
    debug("Removing " + id + "_MODULE","other");
}
ATscriptLoad(modulepath, 'utils');    //Load stuff needed to load other stuff:

//This starts up after 2.5 seconds.
function initializeAutoTrimps() {
    loadPageVariables();            //get autoTrimpSettings
    ATscriptLoad('','SettingsGUI');   //populate Settings GUI
    ATscriptLoad('','Graphs');        //populate Graphs
    //Load modules:
    ATmoduleList = ['query', 'portal', 'upgrades', 'heirlooms', 'buildings', 'jobs', 'equipment', 'gather', 'stance', 'battlecalc', 'maps', 'breedtimer', 'dynprestige', 'fight', 'scryer', 'magmite', 'other', 'import-export', 'client-server', 'perks', /* 'perky', */ 'fight-info', 'performance'];
    for (var m in ATmoduleList) {
        ATscriptLoad(modulepath, ATmoduleList[m]);
    }
    //
    debug('自动脆皮 版本号 ' + ATversion + ' 已加载!', '*spinner3');
}

var changelogList = [];
//changelogList.push({date: " ", version: " ", description: "", isNew: true});  //TEMPLATE
changelogList.push({date: "4/7", version: "-", description: "AutoPerks Zeker0 ratios updated for all levels.", isNew: true});
changelogList.push({date: "4/2", version: "v2.1.6.9b", description: "Import Export, Modules Load code Improvements. Multiple Buttons/Settings Were Combined. AutoPerks code was changed but still functions the same, except for a new Fast-Allocate algorithm (now with a checkbox) that reduces the time to allocate for high helium players to near-instantaneous. Please test new algo; it might overshoot. You can also clear all perks then allocate and have it work now.  AutoMaps no longer considered as being in Lead challenge during Chall^2. ", isNew: true});
changelogList.push({date: "3/23", version: "v2.1.6.9", description: "Game's <u>Map at Zone</u> can be used with AT now, to run maps forever. AutoMaps setting was combined with RunUniqueMaps (variable has changed from boolean false,true to a value 0,1,2). Settings file has been migrated as such. New: Map SpecialMod is sort of working, at least. Geneticist Infinity bugfix. New AGU Settings for 60% Void (fixed). Many Graphs fixes. AutoMaps changes. Equipment Cap, see README at <a target='#' href='https://github.com/genbtc/AutoTrimps/blob/gh-pages/README.md'>GitHub</a> DarkTheme fix. Scientists Fix. Zek450 Perks Preset Changed. Ongoing Development...", isNew: false});
//changelogList.push({date: "3/22", version: "v2.1.6.8", description: "Settings GUI, make better. Import/export improved. Graph buttons: Cycle Up/Down. Internal code fixes. New Graph: Nurseries", isNew: false});
//changelogList.push({date: "3/20", version: "v2.1.6.7", description: "Entirely Re-Arranged Settings Layout. Enjoy! New: Display Tab: EnhanceGrid + Go AFK Mode. GUI: Pinned AT Tab menu bar to top when scrolling. Minimize/Maxi/Close Buttons. ShowChangeLog Button. New Graph: FluffyXP&Xp/Hr (starts@300)", isNew: false});
//changelogList.push({date: "3/13", version: "v2.1.6.6", description: "Geneticist management changes. Equipment code improvements. ATscriptLoad improvements. attempt to track errors.", isNew: false});
//changelogList.push({date: "3/7", version: "v2.1.6.5", description: "Save/Reload Profiles in Import/Export. Magmamancer graph. Magmite/Magma Spam disableable.", isNew: false});

function assembleChangelog(date,version,description,isNew) {
    return (isNew)
    ? (`<b class="AutoEggs">${date} ${version} </b><b style="background-color:#32CD32"> New:</b> ${description}<br>`)
    : (`<b>${date} ${version} </b> ${description}<br>`);
}
function printChangelog() {
    var body="";
    for (var i in changelogList) {
        var $item = changelogList[i];
        var result = assembleChangelog($item.date,$item.version,$item.description,$item.isNew);
        body+=result;
    };
    var footer =
        '<b>Ongoing Development</b> - <u>请报告任何你遇到的Bug/问题</u>!\
        <br>联系开发者: <b>genr8_#8163</b> @ <a target="#" href="https://discord.gg/0VbWe0dxB9kIfV2C">自动脆皮 Discord 通道</a>\
        <br>查看 <a target="#" href="https://github.com/genbtc/AutoTrimps/blob/gh-pages/README.md">使用须知</a> Or check <a target="#" href="https://github.com/genBTC/AutoTrimps/commits/gh-pages" target="#">提交历史</a> (如果你想的话).'
    ,   action = 'cancelTooltip()'
    ,   title = '脚本更新通知<br>' + ATversion
    ,   acceptBtnText = "感谢使用！接受并继续。"
    ,   hideCancel = true;
    tooltip('confirm', null, 'update', body+footer, action, title, acceptBtnText, null, hideCancel);
}
function printLowerLevelPlayerNotice() {
    tooltip('confirm', null, 'update', '对于新玩家来说，这个脚本的运行会误导他们，让他们认为这个脚本是完美的。然而并不是。如果你的最高区域在60以下的话，你还没有解锁所需的统计数据，也没有体验过完整的元数据及其各种范式转换。如果你才刚开始玩这个游戏，我的建议是像平常一样地玩，并且把自动脆皮脚本当做一个工具，而不是一个必要的依靠。你可以调节脚本中的各项设置，就像你在玩另一款游戏。如果你的脚本设置有问题，就不要想着可以放着它不管了，你需要找到一种正确的设置方法。此外，脚本并没有进行一次性挑战的功能，只能重复地进行某个挑战来获得氦。在游戏的这个部分，内容就是王道 - 自动脚本确实消减了游戏的乐趣。如果你发现你的自动操作中存在许多错误，我们将会升级。请记住，维护代码的困难就在于要让它对所有人都生效。自动脚本无法预见到未来的数据，也不会进行模拟运行，它只存在于当下。你可以提一些让脚本变得更好的建议，或是自愿改写代码，或是根据你所了解到的游戏机制，写一些给新手玩家的游戏指南。<br>祝脚本使用愉快。 -genBTC','cancelTooltip()', '<b>致低区域的玩家:</b><br><b>PSA: </b><u>自动脆皮脚本并不是为新的/低区域的玩家所设计。</u>', "我了解并接受这个状况，继续", null, true);
}
////////////////////////////////////////
//Main DELAY Loop///////////////////////
////////////////////////////////////////

//Magic Numbers
var runInterval = 100;      //How often to loop through logic
var startupDelay = 2500;    //How long to wait for everything to load

//Start Loops
setTimeout(delayStart, startupDelay);
function delayStart() {
    initializeAutoTrimps();
    printChangelog();
    setTimeout(delayStartAgain, startupDelay);
}
function delayStartAgain(){
    if (game.achievements.zones.finished < 8)   //z60
        printLowerLevelPlayerNotice();
    //Set some game ars after we load.
    game.global.addonUser = true;
    game.global.autotrimps = true;
    //Actually Start mainLoop and guiLoop
    MODULESdefault = JSON.parse(JSON.stringify(MODULES));
    setInterval(mainLoop, runInterval);
    setInterval(guiLoop, runInterval*10);
    if (autoTrimpSettings.PrestigeBackup !== undefined && autoTrimpSettings.PrestigeBackup.selected != "")
        document.getElementById('Prestige').value = autoTrimpSettings.PrestigeBackup.selected;
    if (document.getElementById('Prestige').value === "")
        document.getElementById('Prestige').value = "Off";

}

////////////////////////////////////////
//Global Main vars /////////////////////
////////////////////////////////////////
////////////////////////////////////////
var ATrunning = true;   //status var
var ATmessageLogTabVisible = true;    //show an AutoTrimps tab after Story/Loot/Unlocks/Combat message Log Container
var enableDebug = true; //Spam console.log with debug info

var autoTrimpSettings = {};
var MODULES = {};
var MODULESdefault = {};
var ATMODULES = {};
var ATmoduleList = [];

var bestBuilding;
var scienceNeeded;
var breedFire = false;

var shouldFarm = false;
var enoughDamage = true;
var enoughHealth = true;

var baseDamage = 0;
var baseBlock = 0;
var baseHealth = 0;

var preBuyAmt;
var preBuyFiring;
var preBuyTooltip;
var preBuymaxSplit;

var currentworld = 0;
var lastrunworld = 0;
var aWholeNewWorld = false;
var needGymystic = true;    //used in setScienceNeeded, buildings.js, equipment.js
var heirloomFlag = false;
var heirloomCache = game.global.heirloomsExtra.length;
var magmiteSpenderChanged = false;

////////////////////////////////////////
//Main LOGIC Loop///////////////////////
////////////////////////////////////////
////////////////////////////////////////
function mainLoop() {
    if (ATrunning == false) return;
    if(getPageSetting('PauseScript') || game.options.menu.pauseGame.enabled || game.global.viewingUpgrades) return;
    ATrunning = true;
    if(game.options.menu.showFullBreed.enabled != 1) toggleSetting("showFullBreed");    //more detail
    addbreedTimerInsideText.innerHTML = parseFloat(game.global.lastBreedTime/1000).toFixed(1) + 's';  //add hidden next group breed timer;
    addToolTipToArmyCount(); //Add hidden tooltip for army count (SettingsGUI.js @ end)
    //Heirloom:
    if (mainCleanup() // Z1 new world
            || portalWindowOpen // in the portal screen (for manual portallers)
            || (!heirloomsShown && heirloomFlag) // closed heirlooms screen
            || (heirloomCache != game.global.heirloomsExtra.length)) { // inventory size changed (a drop appeared)
            // also pre-portal: portal.js:111
        if (getPageSetting('AutoHeirlooms2')) autoHeirlooms2(); //"Auto Heirlooms 2" (heirlooms.js)
        else if (getPageSetting('AutoHeirlooms')) autoHeirlooms();//"Auto Heirlooms"      (")
        if (getPageSetting('AutoUpgradeHeirlooms') && !heirloomsShown) autoNull();  //"Auto Upgrade Heirlooms" (heirlooms.js)

        heirloomCache = game.global.heirloomsExtra.length;
    }
    heirloomFlag = heirloomsShown;
    //Stuff to do  Every new Zone
    if (aWholeNewWorld) {
        // Auto-close dialogues.
        switch (document.getElementById('tipTitle').innerHTML) {
            case 'The Improbability':   // Breaking the Planet
            case 'Corruption':          // Corruption / True Corruption
            case 'Spire':               // Spire
            case 'The Magma':           // Magma
                cancelTooltip();
        }
        if (getPageSetting('AutoEggs'))
            easterEggClicked();
        setTitle(); // Set the browser title
    }
    setScienceNeeded();  //determine how much science is needed

    //EXECUTE CORE LOGIC
    if (getPageSetting('ExitSpireCell') >0) exitSpireCell(); //"Exit Spire After Cell" (other.js)
    if (getPageSetting('BuyUpgradesNew') != 0) buyUpgrades();    //"Buy Upgrades"       (upgrades.js)
    var agu = getPageSetting('AutoGoldenUpgrades');
    if (agu && agu!='Off') autoGoldenUpgradesAT(agu);    //"Golden Upgrades"     (other.js)
    if (getPageSetting('BuyBuildingsNew')===0);                                            //"Buy Neither"              (Buildings.js)
      else if (getPageSetting('BuyBuildingsNew')==1) { buyBuildings(); buyStorage(); }      //"Buy Buildings & Storage"  (")
      else if (getPageSetting('BuyBuildingsNew')==2) buyBuildings();                      //"Buy Buildings"            (")
      else if (getPageSetting('BuyBuildingsNew')==3) buyStorage();                        //"Buy Storage"              (")
    if (getPageSetting('WorkerRatios')) workerRatios();  //"Auto Worker Ratios"  (jobs.js)          
    if (getPageSetting('BuyJobs')) buyJobs();            //"Buy Jobs"            (jobs.js)
    if (getPageSetting('ManualGather2')<=1) manualLabor();  //"Auto Gather/Build"       (gather.js)
      else if (getPageSetting('ManualGather2')==2) manualLabor2();  //"Auto Gather/Build #2"  (")
    getPageSetting('AutoMaps') > 0 ? autoMap() : updateAutoMapsStatus(); //"Auto Maps"      (automaps.js)
    if (getPageSetting('GeneticistTimer') >= 0) autoBreedTimer(); //"Geneticist Timer" / "Auto Breed Timer"     (autobreedtimer.js)
    if (autoTrimpSettings.AutoPortal.selected != "Off") autoPortal();   //"Auto Portal" (hidden until level 40) (portal.js)
    if (getPageSetting('TrapTrimps') && game.global.trapBuildAllowed && game.global.trapBuildToggled == false) toggleAutoTrap(); //"Trap Trimps"
    if (aWholeNewWorld && getPageSetting('AutoRoboTrimp')) autoRoboTrimp();   //"AutoRoboTrimp" (other.js)
    if (aWholeNewWorld && getPageSetting('FinishC2')>0 && game.global.runningChallengeSquared) finishChallengeSquared(); // "Finish Challenge2" (other.js)
    autoLevelEquipment();           //"Buy Armor", "Buy Armor Upgrades", "Buy Weapons", "Buy Weapons Upgrades"  (equipment.js)
    if (getPageSetting('UseScryerStance'))  useScryerStance();  //"Use Scryer Stance"   (scryer.js)
    else if (getPageSetting('AutoStance')<=1) autoStance();     //"Auto Stance"       (stance.js)
    else if (getPageSetting('AutoStance')==2) autoStance2();    //"Auto Stance #2"         (")
    else if (getPageSetting('AutoStance')==3) autoStance3();    //"Auto Stance #3"         (")
    if (getPageSetting('UseAutoGen')) autoGenerator();          //"Auto Generator ON" (magmite.js)
    ATselectAutoFight();  //  pick the right version of Fight/AutoFight/BetterAutoFight/BAF2 (fight.js)
    var forcePrecZ = (getPageSetting('ForcePresZ')<0) || (game.global.world<getPageSetting('ForcePresZ'));
    if (getPageSetting('DynamicPrestige2')>0 && forcePrecZ) prestigeChanging2(); //"Dynamic Prestige" (dynprestige.js)
    else autoTrimpSettings.Prestige.selected = document.getElementById('Prestige').value; //just make sure the UI setting and the internal setting are aligned.
    if (getPageSetting('AutoMagmiteSpender2')==2 && !magmiteSpenderChanged)  autoMagmiteSpender();   //Auto Magmite Spender (magmite.js)
    if (getPageSetting('AutoNatureTokens')) autoNatureTokens();     //Nature     (other.js)
    //
    //Runs any user provided scripts, see line 253 below
    if (userscriptOn) userscripts();
    //
    //rinse, repeat, done
    return;
}

//GUI Updates happen on this thread, every 1000ms
function guiLoop() {
    updateCustomButtons();
    //MODULESdefault = JSON.parse(JSON.stringify(MODULES));
    //Store the diff of our custom MODULES vars in the localStorage bin.
    safeSetItems('storedMODULES', JSON.stringify(compareModuleVars()));
    //Swiffy UI/Display tab
    if(getPageSetting('EnhanceGrids'))
        MODULES["fightinfo"].Update();
    if(typeof MODULES !== 'undefined' && typeof MODULES["performance"] !== 'undefined' && MODULES["performance"].isAFK)
        MODULES["performance"].UpdateAFKOverlay();
}

//reset stuff that may not have gotten cleaned up on portal
function mainCleanup() {
    lastrunworld = currentworld;
    currentworld = game.global.world;
    aWholeNewWorld = lastrunworld != currentworld;
    //run once per portal:
    if (currentworld == 1 && aWholeNewWorld) {
        lastHeliumZone = 0;
        zonePostpone = 0;
        //for the dummies like me who always forget to turn automaps back on after portaling
        if(getPageSetting('AutoMaps')==1 && !game.upgrades.Battle.done && getPageSetting('AutoMaps') == 0)
            settingChanged("AutoMaps");
        return true; // Do other things
    }
}

// Userscript loader. write your own!
//Copy and paste this function named userscripts() into the JS Dev console. (F12)
var userscriptOn = true;    //controls the looping of userscripts and can be self-disabled
var globalvar0,globalvar1,globalvar2,globalvar3,globalvar4,globalvar5,globalvar6,globalvar7,globalvar8,globalvar9;
//left blank intentionally. the user will provide this. blank global vars are included as an example
function userscripts()
{
    //insert code here:
}

function cnname(name){
    var temp=name;
    var text="";
    if(temp=="Core"){
        text="核心";
    }else if(temp=="Buildings"){
        text="建筑";
    }else if(temp=="Jobs"){
        text="工作";
    }else if(temp=="Gear"){
        text="装备";
    }else if(temp=="Maps"){
        text="地图";
    }else if(temp=="Settings"){
        text="设置";
    }else if(temp=="genBTC"){
        text="genBTC";
    }else if(temp=="Uni"){
        text="统一";
    }else if(temp=="Scryer"){
        text="占卜者";
    }else if(temp=="Magma"){
        text="岩浆";
    }else if(temp=="Golden"){
        text="金色";
    }else if(temp=="Nature"){
        text="自然";
    }else if(temp=="Spam"){
        text="垃圾邮件";
    }else if(temp=="Import Export"){
        text="导入/导出";
    }else if(temp=="Discipline"){
        text="纪律"
    }else if(temp=="Daily"){
        text="日常"
    }else if(temp=="Metal"){
        text="金属"
    }else if(temp=="Size"){
        text="尺寸"
    }else if(temp=="Balance"){
        text="平衡"
    }else if(temp=="Scientist V"){
        text="科学家 V"
    }else if(temp=="Scientist"){
        text="科学家"
    }else if(temp=="Meditate"){
        text="冥想"
    }else if(temp=="Decay"){
        text="衰变"
    }else if(temp=="Trimp"){
        text="脆皮"
    }else if(temp=="Trapper"){
        text="捕手"
    }else if(temp=="Electricity"){
        text="电流"
    }else if(temp=="Frugal"){
        text="节俭"
    }else if(temp=="Life"){
        text="生命"
    }else if(temp=="Nom"){
        text="美味"
    }else if(temp=="Lead"){
        text="领导"
    }else if(temp=="Watch"){
        text="观望"
    }else if(temp=="Mapocalypse"){
        text="地图的启示"
    }else if(temp=="Mapology"){
        text="地图学"
    }else if(temp=="Coordinate"){
        text="坐标"
    }else if(temp=="Crushed"){
        text="粉碎"
    }else if(temp=="Toxicity"){
        text="毒性"
    }else if(temp=="Devastation"){
        text="破坏"
    }else if(temp=="Corrupted"){
        text="腐化"
    }else if(temp=="Slow"){
        text="迟钝"
    }else if(temp=="None"){
        text="无"
    }else if(temp=="Off"){
        text="关闭"
    }else if(temp=="Custom"){
        text="定制传送"
    }else if(temp=="Helium Per Hour"){
        text="氦/小时"
    }else if(temp=="Pheromones"){
        text="信息素"
    }else if(temp=="Motivation"){
        text="动机"
    }else if(temp=="Power"){
        text="力量"
    }else if(temp=="Looting"){
        text="掠夺"
    }else if(temp=="Overkill"){
        text="超杀"
    }else if(temp=="Resourceful"){
        text="足智多谋"
    }else if(temp=="Coordinated"){
        text="协作"
    }else if(temp=="Anticipation"){
        text="预期"
    }else if(temp=="Resilience"){
        text="弹性"
    }else if(temp=="Carpentry"){
        text="木工"
    }else if(temp=="Artisanistry"){
        text="艺术性"
    }else if(temp=="Megamace"){
        text="巨型狼牙棒"
    }else if(temp=="Hellishmet"){
        text="地狱头盔"
    }else if(temp=="Supershield"){
        text="超级盾牌"
    }else if(temp=="Dagadder"){
        text="攻击匕首"
    }else if(temp=="Bootboost"){
        text="增速靴"
    }else if(temp=="Polierarm"){
        text="更长武器"
    }else if(temp=="Pantastic"){
        text="七分裤"
    }else if(temp=="Axeidic"){
        text="斧头"
    }else if(temp=="Smoldershoulder"){
        text="阴燃肩"
    }else if(temp=="Greatersword"){
        text="更大的剑"
    }else if(temp=="Bestplate"){
        text="更好的胸甲"
    }else if(temp=="Harmbalest"){
        text="伤害平衡"
    }else if(temp=="GambesOP"){
        text="胫甲OP"
    }else if(temp=="Combat"){
        text="战斗"
    }else if(temp=="Heirlooms"){
        text="传家宝"
    }else if(temp=="Empowerment"){
        text="赋权效果"
    }else if(temp=="Transfer"){
        text="传递比率"
    }else if(temp=="Convert to Wind"){
        text="转换为风符记"
    }else if(temp=="Convert to Ice"){
        text="转换为冰符记"
    }else if(temp=="Convert to Poison"){
        text="转换为毒符记"
    }else if(temp=="Convert to Both"){
        text="转换为另两种符记"
    }else if(temp==""){
        text=""
    }else if(temp==""){
        text=""
    }else if(temp==""){
        text=""
    }else if(temp==""){
        text=""
    }else if(temp==""){
        text=""
    }else{
        return name;
    }
    return text;
}
    
   function cngraph(name){
    var temp=name;
    var text="";
    if(temp=="Trimps"){
        text="脆皮"; 
    }else if(temp=="Helium - He/Hr"){
        text="氦 - 氦/小时"
    }else if(temp=="Helium - Total"){
        text="氦 - 本轮总计"
    }else if(temp=="Helium - He/Hr Instant"){
        text="氦 - 氦/小时 每层"
    }else if(temp=="Helium - He/Hr Delta"){
        text="氦 - 氦/小时 变化量"
    }else if(temp=="HeHr % / LifetimeHe"){
        text="每小时 氦/总获得氦 %"
    }else if(temp=="He % / LifetimeHe"){
        text="氦/总获得氦 %"
    }else if(temp=="Clear Time"){
        text="清除时间"
    }else if(temp=="Cumulative Clear Time"){
        text="累计清除时间"
    }else if(temp=="Run Time"){
        text="运行时间"
    }else if(temp=="Map Bonus"){
        text="地图加成"
    }else if(temp=="Void Maps"){
        text="虚空地图"
    }else if(temp=="Void Map History"){
        text="虚空地图获得记录"
    }else if(temp=="Loot Sources"){
        text="掠夺资源"
    }else if(temp=="Coordinations"){
        text="协作"
    }else if(temp=="GigaStations"){
        text="千兆站"
    }else if(temp=="Unused Gigas"){
        text="未使用千兆站"
    }else if(temp=="Nullifium Gained"){
        text="虚空物质获取"
    }else if(temp=="Dark Essence"){
        text="黑暗精华"
    }else if(temp=="Dark Essence PerHour"){
        text="每小时黑暗精华"
    }else if(temp=="OverkillCells"){
        text="超杀敌人数"
    }else if(temp=="Magmite"){
        text="Magmite"
    }else if(temp=="Magmamancers"){
        text="Magmamancers"
    }else if(temp=="Fluffy XP"){
        text="Fluffy XP"
    }else if(temp=="Fluffy XP PerHour"){
        text="Fluffy XP 每小时"
    }else if(temp=="Nurseries"){
        text="托儿所"
    }else if(temp==""){
        text=""
    }else if(temp==""){
        text=""
    }else{
        return name;
    }
    return text;
}
//test.
function throwErrorfromMain() {
    throw new Error("We have successfully read the thrown error message out of the main file");
}
